package com.chuangmei.com.arindoorlocationsystem.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.chuangmei.com.arindoorlocationsystem.R;
import com.chuangmei.com.arindoorlocationsystem.config.ConfigMessageActivity;

/**
 * 项目名称：ARIndoorLocationSystem
 * 类描述：
 * 创建人：LuoHao
 * 创建时间：2018/4/8 15:54
 * 修改人：LuoHao
 * 修改时间：2018/4/8 15:54
 * 修改备注：
 */

public abstract class BaseFragment extends Fragment {
    protected BaseActivity myActivity;
    protected int layoutID;

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        myActivity = (BaseActivity) getActivity();

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle
            savedInstanceState) {
        layoutID = setLayout();
        View view = null;
        //让碎片加载一个布局
        if (layoutID != -1) {
            view = inflater.inflate(layoutID, container, false);
            initView(view);
        }
        return view;
    }


    protected abstract int setLayout();
    protected abstract void initView(View view);

}
